﻿function fnProject_tableNameRender(oObj) {
var title = "<div class='title'>" +
"<a style='color:black' href='http://www.freelancer.com/projects/" + oObj.aData[project_tableColumnIndexes.seo_url] + ".html'>";
if (oObj.aData[project_tableColumnIndexes.private] == true && oObj.aData[project_tableColumnIndexes.name] == '') {
title += "<span class='ns_bold'>Nonpublic</span> project #" + oObj.aData[project_tableColumnIndexes.id];
} else {
title += oObj.aData[project_tableColumnIndexes.name];
}
title += "</a> " +
getProject_tableOptions(oObj.aData) +
"</div>" +
"<div class='description' style='display:none'>";
if (oObj.aData[project_tableColumnIndexes.private] == true && oObj.aData[project_tableColumnIndexes.name] == '') {
title += "Please login to see the project details.";
} else {
title += oObj.aData[project_tableColumnIndexes.description];
}
title += "</div>";
return title;
}
jq('#project_table tbody tr').live('mouseover', function() {
jq(this).find('.description').show();
});
jq('#project_table tbody tr').live('mouseout', function() {
jq(this).find('.description').hide();
});
jq('.ns_featured.hoverable').live('mouseover', function() {
jq('.generic_hover.featured').css('margin-top','-15px').insertAfter(jq(this));
});
jq('.ns_fulltime.hoverable').live('mouseover', function() {
jq('.generic_hover.fulltime').insertAfter(jq(this));
});
jq('.ns_private-tab.hoverable').live('mouseover', function() {
jq('.generic_hover.nonpublic').insertAfter(jq(this));
});
function fnProject_tableRowCallback(nRow, aData, iDisplayIndex) {
// Enable bid checking on the row
jq(nRow).attr("project_id", aData[project_tableColumnIndexes.id]);
jq(nRow).attr("bid_placed_check",1);
}
function fnProject_tableDrawCallback() {
check_projects_bid_status();
}
function getProject_tableOptions(data) {
var options = "";
if (data[project_tableColumnIndexes.featured] == true) {
options += "<span class='ns_featured ns_icon-misc hoverable' hover_type='featured'></span> ";
}
if (data[project_tableColumnIndexes.fulltime] == true) {
options += "<span class='ns_fulltime ns_icon-misc hoverable' hover_type='fulltime'></span> ";
}
if (data[project_tableColumnIndexes.private] == true) {
options += "<span class='ns_private-tab ns_icon-misc hoverable' hover_type='nonpublic'></span>";
}
return options;
}
function getExtraProject_tableValuesToSend() {
var vals = new Array();
vals.push({"name": "status", "value": "open"});
if (typeof skillsArray != 'undefined') {
vals.push({"name": "skills_chosen", "value": skillsArray});
}
vals.push({"name": "jobIdEnable", "value": "on"});
return vals;
}
